﻿#[derive(Debug, PartialEq)]
pub enum Languages {
    English = 1,
    Chinese = 2,
}

impl Clone for Languages {
    fn clone(&self) -> Self {
        match self {
            Languages::English => Languages::English,
            Languages::Chinese => Languages::Chinese,
        }
    }
}

pub fn get_lang(key: &str, lang: &Languages) -> String {
    match lang {
        Languages::English => match key {
            "kitx_installer" => "KitX Installer".to_string(),
            "steps" => "Steps".to_string(),
            "tip" => "Tip".to_string(),
            "0_hello" => "0. Hello".to_string(),
            "1_license" => "1. License".to_string(),
            "2_install_config" => "2. Installation Config".to_string(),
            "3_install" => "3. Installation".to_string(),
            "4_finish" => "4. Finish".to_string(),
            "previous" => "Previous".to_string(),
            "next" => "Next".to_string(),
            "cancel" => "Cancle".to_string(),
            "install" => "Install".to_string(),
            "finish" => "Finish".to_string(),
            "fetching" => "Fetching ...".to_string(),
            "github" => "GitHub".to_string(),
            "home_page" => "Home Page".to_string(),
            "0_intro" => "    Welcome to KitX Project! You are running the KitX Installer.".to_string(),
            "0_install_on_your_device" => "    This installer will install KitX Dashboard into your device.".to_string(),
            "0_connect_internet" => "    This is a online installer, you need to connect to the internet.".to_string(),
            "0_traffic_charges" => "    We are not responsible for the traffic charges incurred during the installation process.".to_string(),
            "0_fetch_src_codes" => "    You can fetch all source code via".to_string(),
            "0_visit_home_page" => "    Visit our".to_string(),
            "0_for_more" => "for more".to_string(),
            "1_agree" => "  I agree to the terms of the license agreement.".to_string(),
            "2_install_path" => "Installation path: ".to_string(),
            "2_create_desktop_shortcut" => "  Create desktop shortcut.".to_string(),
            "2_create_start_menu_shortcut" => "  Create start menu shortcut.".to_string(),
            "2_install_as_portable_mode" => "  Install as portable software.".to_string(),
            "2_launch_after_install" => "  Launch after installation.".to_string(),
            "2_fetch_desktop_path_failed" => "(Unable to fetch desktop path)".to_string(),
            "2_fetch_start_menu_path_failed" => "(Unable to fetch start menu path)".to_string(),
            "3_installing" => "Installing ...".to_string(),
            "3_view_details" => "View details".to_string(),
            "3_hide_details" => "Hide details".to_string(),
            "4_installed" => "    KitX Dashboard had been installed successfully.".to_string(),
            "4_auto_launch" => "    It will be launched after this window closed.".to_string(),
            "4_manually_launch" => "    You can launch it now!".to_string(),
            "installation_finished" => "Installation finished !".to_string(),
            _ => "Unknown".to_string(),
        },
        Languages::Chinese => match key {
            "kitx_installer" => "KitX 安装器".to_string(),
            "steps" => "步骤".to_string(),
            "tip" => "提示".to_string(),
            "0_hello" => "0. 欢迎".to_string(),
            "1_license" => "1. 许可协议".to_string(),
            "2_install_config" => "2. 安装配置".to_string(),
            "3_install" => "3. 安装".to_string(),
            "4_finish" => "4. 完成".to_string(),
            "previous" => "上一步".to_string(),
            "next" => "下一步".to_string(),
            "cancel" => "取消".to_string(),
            "install" => "安装".to_string(),
            "finish" => "完成".to_string(),
            "fetching" => "获取中 ...".to_string(),
            "github" => "GitHub".to_string(),
            "home_page" => "主页".to_string(),
            "0_intro" => "    欢迎来到 KitX Project! 您正在执行 KitX 安装包.".to_string(),
            "0_install_on_your_device" => "    这个安装包将会安装 KitX Dashboard 到您的设备上.".to_string(),
            "0_connect_internet" => "    这是一个在线安装包, 您需要连接到互联网.".to_string(),
            "0_traffic_charges" => "    我们不对安装过程产生的流量费用负责.".to_string(),
            "0_fetch_src_codes" => "    您可以获取所有的源代码通过".to_string(),
            "0_visit_home_page" => "    访问我们的".to_string(),
            "0_for_more" => "了解更多.".to_string(),
            "1_agree" => "  我同意许可协议的条款.".to_string(),
            "2_install_path" => "安装路径: ".to_string(),
            "2_create_desktop_shortcut" => "  创建桌面快捷方式.".to_string(),
            "2_create_start_menu_shortcut" => "  创建开始菜单快捷方式.".to_string(),
            "2_install_as_portable_mode" => "  安装便携模式.".to_string(),
            "2_launch_after_install" => "  安装完成后启动.".to_string(),
            "2_fetch_desktop_path_failed" => "(无法获取桌面路径)".to_string(),
            "2_fetch_start_menu_path_failed" => "(无法获取开始菜单路径)".to_string(),
            "3_installing" => "正在安装 ...".to_string(),
            "3_view_details" => "展开".to_string(),
            "3_hide_details" => "隐藏".to_string(),
            "4_installed" => "    KitX Dashboard 已经成功被安装到您的设备上.".to_string(),
            "4_auto_launch" => "    KitX Dashboard 将在此窗口关闭后启动.".to_string(),
            "4_manually_launch" => "    您现在可以启动 KitX Dashboard 了".to_string(),
            "installation_finished" => "安装完成 !".to_string(),
            _ => "未翻译".to_string(),
        },
    }
}
